package com.xq.sboot.amqp.tut1;

import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

/**
 * 功能说明:消息配置类.配置生产者和消费者.
 * <p>创建时间: 2019-01-02 17:02</p>
 *
 * @author 郭凯强
 * @version 1.0-SNAPSHOT
 */
@Profile({"tut1", "hello-world"})
@Configuration
public class Config {
    /**
     * 创建队列hello
     * @return 创建的队列 hello
     */
    @Bean
    public Queue hello(){
        return new Queue("hello");
    }

    @Profile("receiver")
    @Bean
    public Receiver receiver(){
        return new Receiver();
    }

    @Profile("sender")
    @Bean
    public Sender sender(){
        return new Sender();
    }
}
